package com.vf.admin.miaodong.entity;

import com.vf.admin.common.db.annotation.Column;
import com.vf.admin.common.db.annotation.NoColumn;
import com.vf.admin.common.db.annotation.Table;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 聊天常用语
 */
@Table(name = "expressions_common")
@Data
public class ExpressionsCommon implements Serializable {

    private static final long serialVersionUID = 1L;

    @Column(length=11,name="id",index=true)
    private Integer id;
    private String content;
    private Integer sex;

    @NoColumn
    private Integer isCommon = 1;

    public static List<ExpressionsCommon> buildEntity(List<ExpressionsUserCustom> customList) {
        List<ExpressionsCommon> list = new ArrayList<>();
        ExpressionsCommon expressionsCommon = null;
        for(ExpressionsUserCustom bean : customList) {
            expressionsCommon = new ExpressionsCommon();
            BeanUtils.copyProperties(bean, expressionsCommon);
            expressionsCommon.setIsCommon(0);
            list.add(expressionsCommon);
        }
        return list;
    }
}
